package com.cctc.demo.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonDeserialize;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.hibernate.annotations.GenericGenerator;

import com.cctc.framework.bean.BaseObj;
import com.cctc.security.util.SqlUtil;

@Entity
@Table(name = "CCTCT_PRODUCT")
public class Product extends BaseObj
{
    private static final long serialVersionUID = 1L;

    @JsonSerialize
    @JsonDeserialize
    @JsonProperty("productid")
    @Id
    @Column(length=36,nullable=false)
    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = SqlUtil.HIBERNATE_UUID)
    private String id;
    
    @JsonSerialize
    @JsonDeserialize
    @JsonProperty("productname")
    @Column(name = "NAME")
    private String name;
    
    @JsonSerialize
    @JsonDeserialize
    @JsonProperty("unitcost")
    @Column(name = "UNITCOST")
    private double unitCost;
    
    @JsonSerialize
    @JsonDeserialize
    @JsonProperty("status")
    @Column(name = "STATUS")
    private String status;
    
    @JsonSerialize
    @JsonDeserialize
    @JsonProperty("listprice")
    @Column(name = "LISTPRICE")
    private double listPrice;
    
    @JsonSerialize
    @JsonDeserialize
    @JsonProperty("attr1")
    @Column(name = "ATTR1")
    private String attr1;
    
    @JsonSerialize
    @JsonDeserialize
    @JsonProperty("itemid")
    @Column(name = "ITEMID")
    private String itemId;
    
    public String getId()
    {
        return id;
    }
    
    public void setId(String id)
    {
        this.id = id;
    }
    
    public String getName()
    {
        return name;
    }
    
    public void setName(String name)
    {
        this.name = name;
    }
    
    public double getUnitCost()
    {
        return unitCost;
    }
    
    public void setUnitCost(double unitCost)
    {
        this.unitCost = unitCost;
    }
    
    public String getStatus()
    {
        return status;
    }
    
    public void setStatus(String status)
    {
        this.status = status;
    }
    
    public double getListPrice()
    {
        return listPrice;
    }
    
    public void setListPrice(double listPrice)
    {
        this.listPrice = listPrice;
    }
    
    public String getAttr1()
    {
        return attr1;
    }
    
    public void setAttr1(String attr1)
    {
        this.attr1 = attr1;
    }
    
    public String getItemId()
    {
        return itemId;
    }
    
    public void setItemId(String itemId)
    {
        this.itemId = itemId;
    }
}
